import 'package:flutter/material.dart';

class GridViewBuilderCase extends StatelessWidget {
  const GridViewBuilderCase({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.all(10),
      child: GridView.builder(
        gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 4, mainAxisSpacing: 10, crossAxisSpacing: 10),
        itemBuilder: (context, index) {
          return Container(
            child: Text(
              '第$index个',
              style: TextStyle(fontSize: 30),
            ),
            color: Colors.blue,
            alignment: Alignment.center,
          );
        },
        itemCount: 30,
      ),
    );
  }
}
